package com.solidumgame.ninja.knife
{	
	import com.pblabs.engine.PBE;
	import com.pblabs.engine.entity.IEntity;
	import com.solidumgame.ninja.knife.KnifeLogicComponent;
	import com.solidumgame.ninja.knife.KnifeRendererComponent;
	import com.solidumgame.ninja.knife.KnifeSoundComponent;
	import com.solidumgame.ninja.knife.KnifeSpatialComponent;
	
	import flash.geom.Point;
	
	/**
	 * 
	 * @author martin
	 * 
	 */	
	
	public class Knife
	{
		protected var spatialComp:KnifeSpatialComponent;
		protected var render:KnifeRendererComponent;
		protected var logic:KnifeLogicComponent;
		protected var soundKnock:KnifeSoundComponent;
		
		protected var myEntity:IEntity;
		
		public static const TYPE:String = "Knife"; 
		
		public function Knife()
		{
			spatialComp  = new KnifeSpatialComponent();
			render = new KnifeRendererComponent();
			logic = new KnifeLogicComponent();
			//soundKnock = new KnifeSoundComponent();
			
			myEntity = PBE.allocateEntity();
			myEntity.addComponent(spatialComp, "Spatial");
			myEntity.addComponent(render, "Renderer");
			myEntity.addComponent(logic, "Logic");
			//myEntity.addComponent(soundKnock,"SoundKnock");
			myEntity.initialize("Knife");
		}
		
		public function remove():void{
			myEntity.destroy();
			
			myEntity = null;
			spatialComp = null;
			//soundKnock = null;
			logic = null;
			render = null;
		}

	}
}